package com.enjia.shopping.ui;

import android.support.v7.widget.LinearLayoutManager;
import android.view.LayoutInflater;
import android.view.View;

import com.enjia.common.framework.BaseFragment;
import com.enjia.enjiashop.R;
import com.enjia.shopping.adapter.OrderShopAdapter;
import com.enjia.shopping.bean.OrderShopBean;
import com.jude.easyrecyclerview.EasyRecyclerView;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

/**
 * 填写订单Fragment
 * Created by feifei on 2017/12/22.
 */

public class ShopOrderFragment extends BaseFragment {
    private View root_view;
    //订单商品列表
    @BindView(R.id.recycle_orderList)
    EasyRecyclerView recycle_orderList;

    //商品列表适配器
    OrderShopAdapter orderAdapter;

    @Override
    protected View onCreateView(LayoutInflater mInflater) {
        root_view = mInflater.inflate(R.layout.fragment_shoporder,null);
        return root_view;
    }

    @Override
    public void initView() {
        recycle_orderList.setLayoutManager(new LinearLayoutManager(mContext));
        orderAdapter = new OrderShopAdapter(mContext);
        recycle_orderList.setAdapter(orderAdapter);
        orderAdapter.addAll(getOrderList());

    }

    @Override
    public void initData() {

    }

    @Override
    public void setListener() {

    }



    @Override
    protected String getTitleValue() {
        return "填写订单";
    }

    private List<OrderShopBean> getOrderList(){
        List<OrderShopBean> orderList = new ArrayList<>();
        for(int i = 0;i<5;i++){
            OrderShopBean bean = new OrderShopBean();
            orderList.add(bean);
        }
        return  orderList;
    }
}
